# from django.contrib import admin
from django.urls import path, include
from . import views
# from .views import my_decorator

app_name = 'admin'

urlpatterns = [
    path('', views.IndexView.as_view(), name="index"),
    path('passwd/', views.Passwd_change.as_view(), name="passwd"),
    # path('index/', views.index_fn, name="index_fn"),
    # path('download/', views.DownloadExecl.as_view(), name='download'),
    path('updates/', views.UpdateIndex.as_view(), name='update'),
    path('column/', views.Zxingtu.as_view(), name='Zxingtu'),
    path('test/', views.Test.as_view(), name='Test'),

    path('tags/', views.TagsManageView.as_view(), name="tags"),
    path('tags/<int:tag_id>/', views.TagEditView.as_view(), name="tags_edit"),
    path('mods/', views.ModManageView.as_view(), name="mods"),
    path('mods/<int:mod_id>/', views.ModEditView.as_view(), name="mods_edit"),
    path('suppliers/', views.SupplierManageView.as_view(), name="suppliers"),
    path('suppliers/<int:sup_id>/', views.SupplierEditView.as_view(), name="suppliers_edit"),

    path('admin/news/', views.NewsManageView.as_view(), name='news_manage'),
    path('news/<int:news_id>/', views.NewsEditView.as_view(), name='news_edit'),
    path('admin/gd/', views.GdManageView.as_view(), name='gd_manage'),
    path('admin/gd/mb', views.GdmbDownLoad.as_view(), name='gd_mb'),
    path('admin/gd/download/', views.Gddownload.as_view(), name='gd_download'),
    path('gd/<int:news_id>/', views.GdEditView.as_view(), name='gd_edit'),
    path('admin/jfgd/', views.JfgdManageView.as_view(), name='jfgd_manage'),
    path('news/pub/', views.NewsPubView.as_view(), name='news_pub'),
    path('news/images/', views.NewsUploadImage.as_view(), name='upload_image'),
    path('token/', views.UploadToken.as_view(), name='upload_token'),  # 七牛云上传图片需要调用token

    path('hotnews/', views.HotNewsManageView.as_view(), name='hotnews_manage'),
    path('hotnews/<int:hotnews_id>/', views.HotNewsEditView.as_view(), name='hotnews_edit'),
    path('hotnews/add/', views.HotNewsAddView.as_view(), name='hotnews_add'),
    path('tags/<int:tag_id>/news/', views.NewsByTagIdView.as_view(), name='news_by_tagid'),

    path('banners/', views.BannerManageView.as_view(), name='banners_manage'),
    path('banners/<int:banner_id>/', views.BannerEditView.as_view(), name='banners_edit'),
    path('banners/add/', views.BannerAddView.as_view(), name='banners_add'),

    path('docs/', views.DocsManageView.as_view(), name='docs_manage'),
    path('docs/<int:doc_id>/', views.DocsEditView.as_view(), name='docs_edit'),
    path('docs/pub/', views.DocsPubView.as_view(), name='docs_pub'),
    path('docs/files/', views.DocsUploadFile.as_view(), name='upload_text'),

    path('courses/', views.CoursesManageView.as_view(), name='courses_manage'),
    path('courses/<int:course_id>/', views.CoursesEditView.as_view(), name='courses_edit'),
    path('courses/pub/', views.CoursesPubView.as_view(), name='courses_pub'),

    path('groups/', views.GroupsManageView.as_view(), name='groups_manage'),
    path('groups/<int:group_id>/', views.GroupsEditView.as_view(), name='groups_edit'),
    path('groups/add/', views.GroupsAddView.as_view(), name='groups_add'),

    path('users/', views.UsersManageView.as_view(), name='users_manage'),
    path('users/<int:user_id>/', views.UsersEditView.as_view(), name='users_edit'),

    path('images/', views.ImagesShow.as_view(), name='images_show'),
]